api_key = ''
llm_model = 'ep-20241104131149-csxf9'
base_url = "https://ark.cn-beijing.volces.com/api/v3"
# 设置OpenAI API密钥
import os

# 导入所需的库
from langchain import PromptTemplate, LLMChain
from langchain_openai import ChatOpenAI

# 原始字符串模板
template = "{flower}的花语是?"
# 创建模型实例
llm = ChatOpenAI(temperature=0, model=llm_model, base_url=base_url, api_key=api_key)
# 创建LLMChain
llm_chain = LLMChain(llm=llm, prompt=PromptTemplate.from_template(template))
# 调用LLMChain，返回结果
result = llm_chain("玫瑰")
print(result)
